import type {baseResponse, listResponse, paramsType} from "@/api/index";
import {useAxios} from "@/api/index";

export interface    chatType {
    "id":  number
    "createdAt": string
    "sessionID": number
    "roleID": number
    "userContent": string
    "aiContent": string
    "sessionTitle": string
    "roleTitle": string
    "roleAvatar": string
    "userNickname": string
    "userAvatar": string
    "imageList": string[]
}

export interface chatCreateType {
    "sessionID":  number
    "content": string
    "imageList"?: string[]
}

export interface chatListParamsType extends paramsType{
    sessionID: number
}


export function chatListApi(params: chatListParamsType): Promise<baseResponse<listResponse<chatType>>>{
     return  useAxios.get("/api/chat", {params})
}
export function chatRemoveApi(idList: number[]):Promise<baseResponse<string>>{
    return useAxios.delete("/api/chat", {data: {idList}})
}
